UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xuo2BRsdWCUIT7ucGtVd29mnDMXWtrqk52k5EH7FhiE=' 
WHERE 
  key_id = '606c47dd98ec2a8a341fb888b77aa3c86a829254e760c8cb416f6d020db6ecdf' 
  AND (
    token = 'xuo2BRsdWCUIT7ucGtVd29mnDMXWtrqk52k5EH7FhiE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034