UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eYtL8JDnXCPllSG/A9293U7GphORF7xi1jx0JPOsQpI=' 
WHERE 
  key_id = '8b0e0cd9bc40d2aeb3bf0ae38d58be94cdd57cba20c75a6c45f37476d096a144' 
  AND (
    token = 'eYtL8JDnXCPllSG/A9293U7GphORF7xi1jx0JPOsQpI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023