UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JB7HBPUVYHF+DkajG5hZUxOgLK5jhPx3g85OsF3v2MY=' 
WHERE 
  key_id = 'e0c26c72e792bc6e6ab169bb41d87808216b013703b94d6bf80aa10891f898f6' 
  AND (
    token = 'JB7HBPUVYHF+DkajG5hZUxOgLK5jhPx3g85OsF3v2MY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048