UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'USFDGYDtjNXyb2NqP/PpzQbAUgRW09D9RO5tmV78KTI='
WHERE
key_id = 'f6d23fefc270092be0babed0f6091550e637a87f193d2269a737690cb52faa55'
AND (
token = 'USFDGYDtjNXyb2NqP/PpzQbAUgRW09D9RO5tmV78KTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)