UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AB6KHaZBPzJibglcUl+sYWUAAuFBL2c36gSaZRUjBuU='
WHERE
key_id = '481f1a31bf95f0983fbdb01d96db6c1a1fc476d7b7ff4dff3e9707b42e3566da'
AND (
token = 'AB6KHaZBPzJibglcUl+sYWUAAuFBL2c36gSaZRUjBuU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)