UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6zpdgSuYKC2tziqXbrdTowyXA7ccW7R3XBlfYfBjDH4=' 
WHERE 
  key_id = 'edb9b392ad8789ea149b4ecd5c35b55d9a6ca0db6abc35fa01e479201042a7c8' 
  AND (
    token = '6zpdgSuYKC2tziqXbrdTowyXA7ccW7R3XBlfYfBjDH4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053