UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OXRUfkKcF7j126o0k2HdRmWfHLM7t8HCiky+Fu/PW/k=' 
WHERE 
  key_id = '8e9011a1f7bbbfc5def4c97fa98a1efea7f2880076caeca8b97f7958cb251391' 
  AND (
    token = 'OXRUfkKcF7j126o0k2HdRmWfHLM7t8HCiky+Fu/PW/k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028