UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tdEajf+MHHA15sYlaece6aW1OOjl2nQMkrrhh/d7q30=' 
WHERE 
  key_id = 'ab3b51fe25efa3787968b43e4b9f72563e7b5f8f9bae3a9feca6689eb1afef82' 
  AND (
    token = 'tdEajf+MHHA15sYlaece6aW1OOjl2nQMkrrhh/d7q30=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030