UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vx2msss5J9EWBMsinsRF2j1Bunw+uatoyEjcw1oqeR0='
WHERE
key_id = 'a0fa3cb4607c6ed889c33853716fc961d1efa9298049dad6cb71c15ca49a87f1'
AND (
token = 'vx2msss5J9EWBMsinsRF2j1Bunw+uatoyEjcw1oqeR0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)