UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NtFG84f+wj1zV0T+i8fFUMZYEkZYZ8HjDgWyRC13Qaw='
WHERE
key_id = '08e7ba70503f0cbe9f05dfec4d332800d6cfbaa5adec81be348de962fd116218'
AND (
token = 'NtFG84f+wj1zV0T+i8fFUMZYEkZYZ8HjDgWyRC13Qaw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)