UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZwHZPkQLEFqia4vBFeITvGl4O/nA54cpUWhdIYdSpHw='
WHERE
key_id = '35ca2d906908f54d2a5e7dd6656b2b753d05626b2f4d7518f221dbbb921128f1'
AND (
token = 'ZwHZPkQLEFqia4vBFeITvGl4O/nA54cpUWhdIYdSpHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)