UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eeJBguihj6fa9vhZhabdvVQ3NKffJarF3ieQcQTkDiI=' 
WHERE 
  key_id = '70a930177f6e22d77b2052d905aeb3958974dd1ec14d741490a042d4932f2d43' 
  AND (
    token = 'eeJBguihj6fa9vhZhabdvVQ3NKffJarF3ieQcQTkDiI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040