UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OhZ9Ay8ekosl/8rtHVBmBGXfIc1tdiZTkHrsEv1m8Wo='
WHERE
key_id = 'e51a89bfbf083a3bd42755497c7a092c73a3b7ae503e2869c8a50fa35e016eda'
AND (
token = 'OhZ9Ay8ekosl/8rtHVBmBGXfIc1tdiZTkHrsEv1m8Wo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)