UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uw1WYzdReaXO/N42TrP3URCAK6CJVL64g8Z2Ssyhl2w='
WHERE
key_id = 'a090017ab83b7e85fb1051c42e5df304952ae6da91e4c8a638f19cd96aa2863e'
AND (
token = 'Uw1WYzdReaXO/N42TrP3URCAK6CJVL64g8Z2Ssyhl2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)