UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0OoMb/SbegaA5GvlwqzhRbUEpgW02r9bcS+5ndmbke8='
WHERE
key_id = 'c2957d192330bea1095be54c760a546944c07e26af895b18120c92ee022024b1'
AND (
token = '0OoMb/SbegaA5GvlwqzhRbUEpgW02r9bcS+5ndmbke8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)