UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zFzLdIAqd5rwAT1LoI5SxsZbwgc9TPo9BFIYhbSKZo4='
WHERE
key_id = '4c680789946e3708359aa30834bcfc0dcb0984775e7ecea3b9271a1dbef0cd90'
AND (
token = 'zFzLdIAqd5rwAT1LoI5SxsZbwgc9TPo9BFIYhbSKZo4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)