UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xbVz+rcBZ/W991KjxJn/r+zEPAroA1ZCsZkxjzBWbpQ='
WHERE
key_id = 'ab55fa362453f2e01be966fd2f2c68b38feb4add47baa5bdba3259a25a438ed7'
AND (
token = 'xbVz+rcBZ/W991KjxJn/r+zEPAroA1ZCsZkxjzBWbpQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)