UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uFL1rOxEOmw64XJ42WB0bSvz5oaq8BQhzN4U7K/HINs='
WHERE
key_id = 'd163d3976bb303332814081fef36f81ee1c153a71afa33fe45fae5f79b10b38d'
AND (
token = 'uFL1rOxEOmw64XJ42WB0bSvz5oaq8BQhzN4U7K/HINs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)