UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Aglj70kZeCk2q3TmCUE3AWBcgDG1Ibg9jHZV4wnIVeU='
WHERE
key_id = '5238a6da6d4b8c18f8ebca8b9ca2b5747ffa146e638e0467baf5f8847094824f'
AND (
token = 'Aglj70kZeCk2q3TmCUE3AWBcgDG1Ibg9jHZV4wnIVeU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)