UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p0tGqJeSlw/RELPz9wm7r748ll80s9rwEPSC2+bgx7k='
WHERE
key_id = '4f3149f1dbbcb993d05b5b96108ea66674a5c5643d8b43b724b32a73395424c7'
AND (
token = 'p0tGqJeSlw/RELPz9wm7r748ll80s9rwEPSC2+bgx7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)