UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'biYhoFcqOnNFtb0QODJ9WS1SpsbSi4fff129ofAxPJ8='
WHERE
key_id = '9565ebda4dc3aed4948f6ef355991e5c2f757d9b2d8d18cb95be38d664ac99bf'
AND (
token = 'biYhoFcqOnNFtb0QODJ9WS1SpsbSi4fff129ofAxPJ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)