UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nrhqx+Hw7Ja8yacSlpaJ/LJuXc+urYjoSedUBbujOAM='
WHERE
key_id = '6d34398719a4d731c8e65b9299bab767a42a0a0ea7734abb3416b37c25d72ab3'
AND (
token = 'nrhqx+Hw7Ja8yacSlpaJ/LJuXc+urYjoSedUBbujOAM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)