UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fLmnf+Vy2b8btdhMCiez//+wGQD/wjuCQKFy53NANg4='
WHERE
key_id = '42c10e61389e67713dc3d3aff24d59109cfc56592db591c39a1ae3ba4fde0ac7'
AND (
token = 'fLmnf+Vy2b8btdhMCiez//+wGQD/wjuCQKFy53NANg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)