UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '10xRWSyutTxUcpaC4QSNPrjrooYWAXOke/TJiOhIFg8='
WHERE
key_id = 'aee958b34bd7b3eeb4b3d49b83f0c90184af016712ae9b6f0d51295b2ba6625c'
AND (
token = '10xRWSyutTxUcpaC4QSNPrjrooYWAXOke/TJiOhIFg8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)