UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gj+A/4cr9Fb+M02h+3BcBtgvSMDxISTYC/W/Y/6C3ic='
WHERE
key_id = '0efae1ded85134e362c45451e049d1ddf55cdf840e34f8189cfd9760693649d4'
AND (
token = 'Gj+A/4cr9Fb+M02h+3BcBtgvSMDxISTYC/W/Y/6C3ic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)