UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4YU8FkWEDO8LaH8N1+9iRwds7qaHMRQjjRVc61kZH1E='
WHERE
key_id = 'd75d4e03ba9ac8a4e2c62cac9e2ad510d3224dc74b795e8fd09b4c2e9e9fd1de'
AND (
token = '4YU8FkWEDO8LaH8N1+9iRwds7qaHMRQjjRVc61kZH1E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)