UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mqRePldnWTEzZ7bolJdlgrHE6XHLcfsFRw2w/c+Xyns='
WHERE
key_id = '67be69c55d754412073e2f9cd57060a2df8b84d65b8f9080f53b2ce413df5e60'
AND (
token = 'mqRePldnWTEzZ7bolJdlgrHE6XHLcfsFRw2w/c+Xyns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)